package edu.gatech.cs4220;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.*;

public class EditProfile extends Activity {
	
	private LocationProfileSet profiles;
	private LocationProfile editedProfile;
	private TextView dispName;
	static final String PROFILE_TO_EDIT = "edu.gatech.cs4220.profile";

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.editprofile);
		Bundle bun = getIntent().getExtras();
		dispName = (TextView)findViewById(R.id.widget38);
		profiles = (LocationProfileSet)bun.get(ProfileList.PROFILES_SET);
		editedProfile = (LocationProfile)bun.get(EditProfile.PROFILE_TO_EDIT);
		dispName.setText(editedProfile.getName());
	}
	public void editNameButton(View view)
	{
		Intent myIntent = new Intent(view.getContext(), EditName.class);
		myIntent.putExtra(ProfileList.PROFILES_SET, profiles);
		myIntent.putExtra(ProfileName.NEW_PROFILE_NAME,editedProfile.getName());
		myIntent.putExtra(EditProfile.PROFILE_TO_EDIT,editedProfile);
		startActivityForResult(myIntent, 0);
	}
	public void editLocationButton(View view)
	{
		Intent myIntent = new Intent(view.getContext(), EditLocation.class);
		myIntent.putExtra(ProfileList.PROFILES_SET, profiles);
		myIntent.putExtra(ProfileName.NEW_PROFILE_NAME,editedProfile.getName());
		myIntent.putExtra(EditProfile.PROFILE_TO_EDIT,editedProfile);
		startActivityForResult(myIntent, 0);
	}
	public void editFunctionsButton(View view)
	{
		Intent myIntent = new Intent(view.getContext(), EditFunction.class);
		myIntent.putExtra(ProfileList.PROFILES_SET, profiles);
		myIntent.putExtra(ProfileName.NEW_PROFILE_NAME,editedProfile.getName());
		myIntent.putExtra(EditProfile.PROFILE_TO_EDIT,editedProfile);
		startActivityForResult(myIntent, 0);
	}
	public void saveButton(View view)
	{
		finish();
	}
	public void deleteButton(View view)
	{
		
	}
	public void disableButton(View view)
	{
		
	}
}
